Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix a flaky test #1533

Merged
merged 1 commit into from
Nov 20, 2020
Merged

test: Fix a flaky test #1533

merged 1 commit into from
Nov 20, 2020

Conversation

michael-c-snyk
Copy link
Contributor

@michael-c-snyk michael-c-snyk commented Nov 19, 2020

In the modified test file, sleep() is backed by setTimeout(), and some Node runtimes might execute setTimeout callback before the specified delay, meaning that tmi.getValue() will occasionally return 9. This produces a flaky test, eg https://app.circleci.com/pipelines/github/snyk/snyk/3074/workflows/f11955a8-5ffc-450a-94be-387dfdfc55a8/jobs/17080. An extra ms leeway in the assertion works round the issue. nodejs/node#10154.

Test name updated to reflect that the timer's accuracy does not have single-digit precision

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

In the modified test file, sleep() is backed by setTimeout(), and some Node runtimes might execute setTimeout callback before the specified delay, meaning that tmi.getValue() will occasionally return `9`. This produces a flaky test. An extra ms leeway in the assertion works round the issue. nodejs/node#10154

Test name updated to reflect that the timer's accuracy does not have single-digit precision
@michael-c-snyk michael-c-snyk requested review from a team as code owners November 19, 2020 21:20
@ghost ghost requested review from anthogez and aviadhahami November 19, 2020 21:20
@michael-c-snyk michael-c-snyk self-assigned this Nov 19, 2020
@github-actions
Copy link
Contributor

Messages
📖

This PR will not trigger a new version. It doesn't include any commit message with feat or fix.

Generated by 🚫 dangerJS against ebe95cb

Copy link
Contributor

@JackuB JackuB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, silly

@michael-c-snyk michael-c-snyk merged commit e95484f into master Nov 20, 2020
@michael-c-snyk michael-c-snyk deleted the test/fixMetricTest branch November 20, 2020 09:25
@snyksec
Copy link

snyksec commented Nov 20, 2020

🎉 This PR is included in version 1.430.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants